import {BaseEntity, Column, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, OneToOne, PrimaryColumn, PrimaryGeneratedColumn, RelationId} from 'typeorm';

@Entity('mall_goods', {schema: 'nest-mall' } )
@Index('goods_sn', ['goodsSn' ])
@Index('cat_id', ['categoryId' ])
@Index('brand_id', ['brandId' ])
@Index('goods_number', ['goodsNumber' ])
@Index('sort_order', ['sortOrder' ])
export class MallGoods {

    @PrimaryGeneratedColumn({
        type: 'int',
        name: 'id',
        })
    id: number;

    @Column('int', {
        nullable: true,
        default: () => '\'0\'',
        name: 'category_id',
        })
    categoryId: number | null;

    @Column('varchar', {
        nullable: true,
        length: 60,
        name: 'goods_sn',
        })
    goodsSn: string | null;

    @Column('varchar', {
        nullable: false,
        length: 120,
        name: 'name',
        })
    name: string;

    @Column('int', {
        nullable: true,
        default: () => '\'0\'',
        name: 'brand_id',
        })
    brandId: number | null;

    @Column('mediumint', {
        nullable: true,
        default: () => '\'0\'',
        name: 'goods_number',
        })
    goodsNumber: number | null;

    @Column('varchar', {
        nullable: true,
        name: 'keywords',
        })
    keywords: string | null;

    @Column('varchar', {
        nullable: true,
        name: 'goods_brief',
        })
    goodsBrief: string | null;

    @Column('text', {
        nullable: true,
        name: 'goods_desc',
        })
    goodsDesc: string | null;

    @Column('tinyint', {
        nullable: true,
        default: () => '\'1\'',
        name: 'is_on_sale',
        })
    isOnSale: number | null;

    @Column('datetime', {
        nullable: true,
        name: 'add_time',
        })
    addTime: Date | null;

    @Column('smallint', {
        nullable: true,
        default: () => '\'100\'',
        name: 'sort_order',
        })
    sortOrder: number | null;

    @Column('tinyint', {
        nullable: true,
        default: () => '\'0\'',
        name: 'is_delete',
        })
    isDelete: number | null;

    @Column('int', {
        nullable: true,
        default: () => '\'0\'',
        name: 'attribute_category',
        })
    attributeCategory: number | null;

    @Column('decimal', {
        nullable: true,
        default: () => '\'0.00\'',
        scale: 2,
        name: 'counter_price',
        })
    counterPrice: string | null;

    @Column('decimal', {
        nullable: true,
        default: () => '\'0.00\'',
        scale: 2,
        name: 'extra_price',
        })
    extraPrice: string | null;

    @Column('tinyint', {
        nullable: true,
        default: () => '\'0\'',
        name: 'is_new',
        })
    isNew: number | null;

    @Column('varchar', {
        nullable: true,
        length: 45,
        name: 'goods_unit',
        })
    goodsUnit: string | null;

    @Column('varchar', {
        nullable: true,
        name: 'primary_pic_url',
        })
    primaryPicUrl: string | null;

    @Column('varchar', {
        nullable: true,
        name: 'list_pic_url',
        })
    listPicUrl: string | null;

    @Column('decimal', {
        nullable: true,
        default: () => '\'0.00\'',
        scale: 2,
        name: 'retail_price',
        })
    retailPrice: string | null;

    @Column('int', {
        nullable: true,
        default: () => '\'0\'',
        name: 'sell_volume',
        })
    sellVolume: number | null;

    @Column('int', {
        nullable: true,
        default: () => '\'0\'',
        name: 'primary_product_id',
        })
    primaryProductId: number | null;

    @Column('decimal', {
        nullable: true,
        default: () => '\'0.00\'',
        scale: 2,
        name: 'unit_price',
        })
    unitPrice: string | null;

    @Column('varchar', {
        nullable: true,
        name: 'promotion_desc',
        })
    promotionDesc: string | null;

    @Column('varchar', {
        nullable: true,
        length: 45,
        name: 'promotion_tag',
        })
    promotionTag: string | null;

    @Column('decimal', {
        nullable: true,
        scale: 2,
        name: 'app_exclusive_price',
        })
    appExclusivePrice: string | null;

    @Column('tinyint', {
        nullable: true,
        name: 'is_app_exclusive',
        })
    isAppExclusive: number | null;

    @Column('tinyint', {
        nullable: true,
        name: 'is_limited',
        })
    isLimited: number | null;

    @Column('tinyint', {
        nullable: true,
        default: () => '\'0\'',
        name: 'is_hot',
        })
    isHot: number | null;

    @Column('decimal', {
        nullable: true,
        default: () => '\'0.00\'',
        scale: 2,
        name: 'market_price',
        })
    marketPrice: string | null;

    @Column('bigint', {
        nullable: true,
        name: 'create_user_id',
        })
    createUserId: string | null;

    @Column('bigint', {
        nullable: true,
        name: 'update_user_id',
        })
    updateUserId: string | null;

    @Column('datetime', {
        nullable: true,
        name: 'update_time',
        })
    updateTime: Date | null;

    @Column('bigint', {
        nullable: true,
        name: 'create_user_dept_id',
        })
    createUserDeptId: string | null;

}
